﻿package export.level
{
	import base.BaseLevelListener;
	
	import flash.display.*;
	
	public class StageListener01 extends BaseLevelListener
	{
		
		public function StageListener01()
		{
			super();
		}
		
		private var rwDoor:MovieClip;
		private var pkDoor:MovieClip;
		
		override public function start():void
		{
			super.start();
			this.loadGameSenceSource();
		}
		
		override public function destroy():void
		{
			super.destroy();
		}
		
		public function loadGameSenceSource():void
		{
			var _loc1_:* = null;
			var _loc2_:uint = gc.gameScene.numChildren;
			var _loc3_:int = 0;
			while (_loc3_ < _loc2_)
			{
				_loc1_ = gc.gameScene.getChildAt(_loc3_);
				if (_loc1_ is MovieClip)
				{
					if (MovieClip(_loc1_).name == "rwDoor")
					{
						this.rwDoor = _loc1_ as MovieClip;
						this.rwDoor.buttonMode = true;
						this.rwDoor.tabEnabled = false;
					}
					else if (MovieClip(_loc1_).name == "pkDoor")
					{
						this.pkDoor = _loc1_ as MovieClip;
						this.pkDoor.buttonMode = true;
						this.pkDoor.tabEnabled = false;
					}
				}
				_loc3_++;
			}
		}
		
		public function checkRwOrPk():void
		{
			/*var _loc1_:Boolean = false;
			if (gc.hero1)
			{
				if (gc.hero1.colipse.hitTestObject(this.pkDoor))
				{
					_loc1_ = true;
				}
			}
			if (gc.hero2)
			{
				if (gc.hero2.colipse.hitTestObject(this.pkDoor))
				{
					_loc1_ = true;
				}
			}
			if (_loc1_)
			{
				return;
			}
			if (gc.hero1)
			{
				if (gc.hero1.colipse.hitTestObject(this.rwDoor))
				{
					_loc1_ = true;
				}
			}
			if (gc.hero2)
			{
				if (gc.hero2.colipse.hitTestObject(this.rwDoor))
				{
					_loc1_ = true;
				}
			}
			if (_loc1_)
			{
				gc.keyboardControl.stopAllControl();
				new TaskInter();
			}*/
		}
	}
}
